package com.zxy.ziems.server.energy.enums;

public enum TimeDimensionEnum {

    MONTH(0, "月"),
    YEAR(1, "年");

    private final Integer code;
    private final String info;

    TimeDimensionEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public static TimeDimensionEnum getByCode(Integer code) {
        for (TimeDimensionEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }
}
